const fs = require('fs')

fs.readFile('./files/grade.txt','utf-8',(err,data)=>{
    if(err){
        return console.log(err)
    }
    const arr = data.split(' ')
    const gradeArr = []
    arr.forEach(item=>{
        gradeArr.push(item.replace('=',':'))
    })
    const newStr = gradeArr.join('\r\n')
    fs.writeFile('./files/gradeOk.txt',newStr,'utf-8',(err)=>{
        if(err){
            return console.log('写入失败',err)
        }
        console.log('写入成功')
    })
})